﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp22
{
    class Program
    {
//        定义一个结构体，名为PersonStruct，有三个成员变量：姓名、电话、地址，
//在主方法中，创建一个PersonStruct结构体对象p1，为p1的成员变量赋值。
//再声明一个PersonStruct结构体变量p2，把p1赋值给p2，改变p2的姓名，打印p1的内容。

//定义一个类，名为PersonClass，有三个成员变量：姓名、电话、地址，
//在主方法中，创建一个PersonClass对象p3，为p3的成员变量赋值。
//再声明一个PersonClass变量p4，把p3赋值给p4，改变p4的姓名，打印p3的内容。
    struct PersonStruct
        {

            public string name;
            public string phone;
            public string address;
            public PersonStruct(string name,string phone,string address)
            {

                this.address = address;
                this.name = name;
                this.phone = phone;


            }

        }

        static void Main(string[] args)
        {
            PersonStruct p1 = new PersonStruct();
            p1.name = "啦啦";
            p1.phone = "315465876865";
            p1.address = "北京市三环路";

            PersonStruct p2 = new PersonStruct();
            p2.name = "啦";
            p2.phone = "315465876865";
            p2.address = "三环路";
            p2 = p1;
            p2.name = "fdkg";
            Console.WriteLine(p1.name,p1.phone,p1.address);



            PersonClass p3 = new  PersonClass();
            p3.name = "啦啦";
            p3.phone = "315465876865";
            p3.address = "北京市三环路";

            PersonClass p4 = new PersonClass();
            p4.name = "啦";
            p4.phone = "315465876865";
            p4.address = "三环路";
            p4 = p3;
            p4.name = "fdkg";
            Console.WriteLine(p3.name, p3.phone, p3.address);
        }
    }
}
